package com.loyal.loyalerp.mapper.provider;

public class EmployeeProvider {
	public String listEmployee(String sidx, String sord) {
		return "select * from employee order by " + sidx + " " + sord;
	}

	public String findEmployee(String searchField, String searchString) {
		if (searchField.equals(new String("chName"))) {
			searchField = new String("ch_name");
			return "select * from employee where " + searchField + " like CONCAT(CONCAT(\'%\',\'" + searchString
					+ "\',\'%\'))";
		} else if (searchField.equals(new String("enName"))) {
			searchField = new String("en_name");
			return "select * from employee where " + searchField + " like CONCAT(CONCAT(\'%\',\'" + searchString
					+ "\',\'%\'))";
		} else {
			return "select * from employee where " + searchField + " like CONCAT(CONCAT(\'%\',\'" + searchString
					+ "\',\'%\'))";
		}

	}

}
